<html>
<head>
<script type="text/javascript">
function getText()
  {
  var x=document.getElementById("frame1").contentDocument.getElementsByTagName('h3').value;
  alert(x);
  }
</script>
</head>
<body>

<iframe src="http://www.w3school.com.cn/example/hdom/frame_a.html" id="frame1" ></iframe>
<br /><br />
<input type="button" onClick="getText()" value="Get text" />

</body>
</html>
